$(function(){
	$(':text').focus(function() {
		if ($(this).val() === this.defaultValue)	{
			$(this).val('');
			$(this).css("color","#000");
		}
	});

	$(':text').blur(function() {
		if ($(this).val() === ''){
			$(this).val(this.defaultValue);
			$(this).css("color","#ccc");
		}
	});

	$('textarea').focus(function() {
		if ($(this).val() === this.defaultValue)	{
			$(this).val('');
			$(this).css("color","#000");
		}
	});
	$('textarea').blur(function() {
		if ($(this).val() === ''){
			$(this).val(this.defaultValue);
			$(this).css("color","#ccc");
		}
	});

	$("select").change(function(){
	   $(":selected").css("color","#000");
	   if ($(":selected").index() == 0){
			$(this).eq(0).css("color","#ccc");
		}else{
			$(this).css("color","#000");
		}

	});
	/*$("select").blur(function() {
		if ($(this).selectedIndex = 0){
			$(this).css("color","#ccc");
		}
	});*/

	$('#addVehicle').click(function(){
		var target1=$('#addVehicle-win');
		//alert(target1.width());
		openPopWin(target1);
	});
	$('#regVehicle').click(function(){
		var target2=$('#regVehicle-win');
		//alert(target1.width());
		openPopWin(target2);
	});
	$('.setPos').click(function(){
		var target3=$('#setPos-win');
		//alert(target1.width());
		openPopWin(target3);
	});

	/*$('.continuousPos').click(function(){
		var target4=$('#continuousPos-win');
		//alert(target1.width());
		openPopWin(target4);
	});*/
	$('#distributeOper').click(function(){
		var target5=$('#distributeOper-win');
		//alert(target1.width());
		openPopWin(target5);
	});
	$('#addDailyincome').click(function(){
		var target6=$('#addDailyincome-win');
		//alert(target1.width());
		openPopWin(target6);
	});
	$('#addBusinessincome').click(function(){
		var target7=$('#addBusinessincome-win');
		//alert(target1.width());
		openPopWin(target7);
	});
	$('.detail-btn').click(function(){
		var target8=$('#detail-win');
		//alert(target1.width());
		openPopWin(target8);
	});
	$('.receivePay').click(function(){
		var target9=$('#receivePay-win');
		//alert(target1.width());
		openPopWin(target9);
	});
	$('.detail-Adjust').click(function(){
		var target10=$('#detail-Adjust-win');
		//alert(target1.width());
		openPopWin(target10);
	});
	$('.income-Adjust').click(function(){
		var target11=$('#income-Adjust-win');
		//alert(target1.width());
		openPopWin(target11);
	});
	$('.change-account').click(function(){
		var target12=$('#change-account-win');
		//alert(target1.width());
		openPopWin(target12);
	});

	$('#cwqxsz').click(function(){
		var target13=$('#cwqxsz-win');
		//alert(target1.width());
		openPopWin(target13);
	});

	$('#sendMess').click(function(){
		var target14=$('#sendMess-win');
		//alert(target1.width());
		openPopWin(target14);
	});
	$('#feeDetail').click(function(){
		var target15=$('#feeDetail-win');
		//alert(target1.width());
		openPopWin(target15);
	});

	$('.rclose,#be_save1,#be_save2,#be_save3,#be_save4,#be_save6,#be_save7,#be_save8,#btn_close,#btn_close7').click(function(){
		closePopWin();
	});


})


var w = document.body.scrollWidth,
	h = document.body.scrollHeight;
function openPopWin(target){
		$('body').add('html').css('height','100%').css('width','100%').css('overflow','visible');

		$('#paytobankbg').css('width',w).css('height',h);//.css('position','relative').css('top','-1000px');
		$('#paytobankbg').css('display','block');      //显示
		target.css('display','block');       //显示
		//$("#be_query").submit();
}
function closePopWin(){
		$('#paytobankbg').css('display','none');
		$('.pop-win').css('display','none');
		$('body').add('html').css('height','100%').css('width','100%');//.css('overflow','auto');
}